package model.datastructure;

/**
 * An <code>AbstractField</code> represents a field where blocks can be placed.
 * 
 * @version 0.1 11/24/10
 * @author Ingmar te Raa
 * 
 * @see IDimension
 */
public abstract class AbstractField {

	/**
	 * The dimension of the <code>AbstractField.</code>
	 */
	protected IDimension mDimension;

	/**
	 * Create a new <code>AbstractField</code>.
	 * 
	 * @param dimension
	 *            - the dimension of the field. Use an instance of IDimension.
	 * @see IDimension
	 */
	public AbstractField( IDimension dimension ) {
		this.mDimension = dimension;
	}

	/**
	 * Get the dimension of the <code>AbstractField</code>.
	 * 
	 * @return Returns the dimension of this <code>AbstractField</code>.
	 */
	public IDimension getDimension() {
		return mDimension;
	}

	/**
	 * Place a block in this field. If the block can not be placed, a
	 * <code>RuntimeException</code> is thrown.
	 * 
	 * @param position
	 *            - the position where the block must be placed.
	 * @param block
	 *            - the block witch have to be placed.
	 * @throws RuntimeException
	 * @see AbstractBlcok
	 * @see IPosition
	 */
	public abstract void placeBlock( AbstractBlock block ) throws RuntimeException;

	public abstract AbstractSurface2D getSurface();

}